package com.walker.jdkapi.thread.pool;

import java.util.concurrent.LinkedBlockingQueue;

public class Customer implements Runnable {

	// 生产商品池
	private volatile LinkedBlockingQueue<Noodle> lbq;
	
	private boolean isRunning = true;
	
	private String name;

	public Customer(LinkedBlockingQueue<Noodle> lbq, String name) {
		super();
		this.lbq = lbq;
		this.name = name;
	}

	@Override
	public void run() {
		while(isRunning) {
			try {
				Noodle noodle = lbq.take();
				System.out.println("客户," + name + "点餐：" + noodle.getName());
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}
